package org.geekbang.thinking.in.spring.conversion.event.listener;

import org.geekbang.thinking.in.spring.conversion.event.pub.CustomSpringEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

@Component
public class CustomEventListener {

    @EventListener
    public void handleCustomEvent(CustomSpringEvent event) {
        System.out.println("Received custom event - " + event.getMessage());
    }

    @EventListener
    public void handleCustomEventAsync(CustomSpringEvent event) {
        System.out.println("Async handling custom event - " + event.getMessage());
    }
}
